package com.hainatong.shiphelper.api;

import com.base.common.app.BaseConstant;
import com.base.common.model.http.jackSon.JacksonUtils;
import com.base.common.utils.SPUtils;
import com.hainatong.shiphelper.login.model.UserInfo;

public class PublicValues {

    private static UserInfo.DataBean userInfo;//用户信息


    public static UserInfo.DataBean getUserInfo() {
        if (userInfo == null) {
            userInfo = JacksonUtils.getJsonBean(SPUtils.getString(BaseConstant.USER_BEAN,""), UserInfo.DataBean.class);
        }

        return userInfo;
    }

    public static void setUserInfo(UserInfo.DataBean userInfoNew) {
        if (userInfoNew != null) {
            userInfo=userInfoNew;
            SPUtils.putBean(BaseConstant.USER_BEAN, userInfoNew);
        }
    }


}
